home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Free 38
/
Commodore_Free_Issue_38_2010_Commodore_Computer_Club.d64
/
minigrafik 2
< prev
next >
Wrap
Text File
|
2023-02-26
|
5KB
|
190 lines
*************************************
MINIGRAFIK FOR THE VIC 20
*************************************
http://www.sleepingelephant.com/
ipw-web/bulletin/bb/viewtopic.
php?t=952&start=49
New version 4.02 of MINIGRAFIK!
Improvements to version 3.2:
- The @ command (point plot, line
draw), and the @() function have
been extended to support
Multi-Colour mode.
- @SAVE, @LOAD command added (see
below)
- faster start-up time
Symbol explanations:
<...> denotes parameter expressions
[...] denotes optional parts of a
parameter list
Commands:
@ON initialises the 160x192 pixel
graphics. The screen is recentered
correctly regardless of MINIGRAFIK
running on a NTSC or PAL VIC.
@CLR clears the hires screen.
Furthermore the Colour RAM is
initialised to the foreground colour.
@RETURN returns to text mode. If an
error occurs during program
execution, this command is executed
on your behalf before outputting the
error message.
@<colour>,<x>,<y> [TO <x2>,<y2>]
Draw line in <colour> from (<x>,<y>)
to (<x2>,<y2>). If the TO part is
omitted, a single point at (<x>,<y>)
is plotted.
<colour> denotes a logical colour.
<x> and <x2> may range from 0 to
159, <y> and <y2> from 0 to 191. The
origin (x=0, y=0) lies in the
top-left corner. All arguments can
be written as numbers, variables, or
arbitrary numeric expressions.
In High-Resolution mode (M=0) the
allowed logical colours are:
0: clear pixel to background colour G
1: set pixel in foreground colour F
In Multi-Colour mode (M=1) two extra
logical colours become available:
2: set pixel in border colour B
3: set pixel in auxiliary colour A
In Multi-Colour mode the resolution
is halved, so that when <x> is even,
<x> and <x>+1 address the same pixel.
The foreground colour (F=0..7) and
Multi-Colour enable (M=0..1) are set
individually for each 8x16 pixel
cell. The background colour
(G=0..15), border colour (B=0..7),
and auxiliary colour (A=0..15) apply
to the whole screen.
To assign a physical colour to the
logical colours, issue the following
POKEs:
POKE 36879,16*G+8+B
(set background, and border colour)
POKE 36878,16*A
(set auxiliary colour)
POKE 646,8*M+F
(set foreground colour, and
enable/disable MC mode)
Physical Colour Table:
0 Black 8 Orange
1 White 9 Light Orange
2 Red 10 Light Red
3 Cyan 11 Light Cyan
4 Purple 12 Light Purple
5 Green 13 Light Green
6 Blue 14 Light Blue
7 Yellow 15 Light Yellow
@SAVE [<filename> [,<device>]]
Save screen to device. A
device-number greater than or equal
8 addresses the disc drive. In that
case a filename must be given.
If the device-number is omitted, or
equal 1, the screen is saved to
tape. @SAVE without any parameters
saves an unnamed screen to tape. A
tape save notifies the user with a
border flashing black/red to press
RECORD & PLAY on the tape drive.
When the save has completed, your
program continues execution.
The file contains a stand-alone
display routine, to view the image
via LOAD and RUN without MINIGRAFIK
in memory. If MINIGRAFIK is loaded,
use @LOAD instead, inside a program.
Memory Map:
MINIGRAFIK MINIGRAFIK
active not active
----------- ----------- -----------
$1000-$10EF char map
$10F0 free
$10F1-$10FD $1201-$120D SYS 8584
$10FE $120E 36878 reg
$10FF $120F 36879 reg
$1100-$1FFF $1210-$210F bitmap
$2000-$2077 $2110-$2187 colour
$2078-$20EF $2188-$21FF display prg
@LOAD [<filename> [,<device>]]
Load screen from device. A
device-number greater than or equal
8 addresses the disc drive. In that
case a filename must be given.
If the device-number is omitted, or
equal 1, the screen is loaded from
tape. @LOAD without any parameters
loads the next screen from tape. A
tape load notifies the user with a
border flashing black/green to press
PLAY on the tape drive.
When the load has completed, the
image is displayed on screen, and
your program continues execution
after the @LOAD command. There is no
wait for a key press.
DO NOT load anything else than a
@SAVEd screen with @LOAD!
Functions:
@(<x>,<y>)
This function returns the logical
colour at (<x>,<y>). <x> may range
from 0 to 159, <y> from 0 to 191.
Both arguments can be written as
numbers, variables, or arbitrary
numeric expressions.
For a High-Resolution 8x16 pixel
cell, the function returns 0 for
background, and 1 for foreground
colour. If the cell is Multi-Colour
and <x> is even, then <x> and <x>+1
share the same logical colour, & you
must be prepared for the function to
return values from 0 to 3.
===================================